<!--
驾驶员管理
-->
<template>
    <div>
        <listModule :template-data="templateData"></listModule>
        <vBillDetailWrap :pageUri="pageUri" :billId="billId" :templateId="templateBillId"></vBillDetailWrap>
    </div>
</template>

<script>
import vBillDetailWrap from '@/components/billDetailWrap';
import template from './template2.js';
export default {
    name: 'Illegal',
    data() {
        return {
            specialBtn: [],
            templateId: '',
            pageUri: '',
            billId: '',
            templateBillId: '',
            billData: {},
            viewId: 'bc884502-0ae2-476a-9b3e-cc66a9c6d484', // 导入按钮需要viewId
            showTree: null, // 0不显示，1显示
            searchGrid: {
                orgCode: '',
                deptCode: ''
            },
            treeParams: {
                treeCode: 'AgencyDeptService',
                search_roleType: '',
                isGetAll: true
            },
            editItems: ['setYear'],
            templateData: template
        };
    },
    components: {
        vBillDetailWrap
    },
    computed: {
    },
    mounted() {
        console.log(this.templateData)
        // this.avehMatchRole();
        this.templateId = this.$route.query.templateId;
        this.pageUri = this.$route.path;
    },
    methods: {
        selfBtn(code) {
            switch (code) {
                case 'ADD':
                    this.add();
                    break;
            }
        },
        add() {},
        getId(tempId, row, billId) {
            this.templateBillId = tempId;
            this.billId = billId;
            this.billData = row;
        },
        // 工作流方法回调
        listWork(workType, _this, selectedData, selectedStatus, businessId, options, isTable) {
            switch (workType) {
                case 'submit':
                    this.workFlowFun.listSubmit(_this, selectedData, selectedStatus, businessId, isTable);
                    break;
                case 'takeBack':
                    this.workFlowFun.listWorkFlow('takeBack', _this, selectedData, selectedStatus, businessId, isTable);
                    break;
            }
        },
        // 导入
        importSave(btnInfor, data) {
            this.$post(btnInfor.path, data).then(result => {
                this.success(result.msg);
                // 列表导入
                if (this.showTree === '0') {
                    this.$refs.listModule.freshTable();
                } else {
                    // 左树右表导入
                    this.$refs.treeSearch.$refs.listModule.freshTable();
                }
            });
        },
        // 判断是否显示左侧树
        avehMatchRole() {
            this.$get(this.$API.avehMatchRole).then(res => {
                this.showTree = res.data;
                if (res.data === '2') {
                    this.treeParams.search_roleType = '2';
                    this.showTree = '1';
                }
            });
        }
    }
};
</script>

<style scoped></style>
